1. Field of the Invention
The present invention relates to a packet switch for forwarding a packet to a WAN side and a LAN side.
2. Description of the Related Art
There has been an increase in methods that construct an intra-company wide-area LAN by connecting bases of a company to each other via WAN lines and disposing a MAC packet switch at an entry to each of the bases. FIG. 19 is a diagram showing an example of a constructed intra-company wide-area LAN. As shown in FIG. 19, an office LAN 2#i (i=1, 2, . . . ) accommodating terminals such as of personal computers is connected to a MAC packet switch (SW) 4#i (i=1, 2, . . . ). In this case, a LAN side interface of the SW 4#i is an Ether or the like. The SW 4#i has a plurality of lines on a WAN 6 side. An interface of the SW 4#i with the WAN 6 side is MAC over ATM for allowing MAC packets to be contained in ATM cells, or the like. The SWs 4#i (i=1, 2, . . . ) of the bases are connected to each other on the WAN 6 side by a mesh, a ring or the like. The SW 4#i operates as a MAC packet bridge having an address learning function.
When a MAC packet is inputted from the office LAN 2#i, the SW 4#i registers, in a learning table, the source MAC address (source address) of the packet such that the source MAC address is associated with a port where the packet is inputted, thereby learning the,MAC address. In addition, the SW 4#i constructs a packet from an ATM cell inputted to a WAN port connected to a WAN line, and then registers, in the learning table, the source MAC address (source address) of the packet such that the source MAC address is associated with the input port, thereby learning the MAC address. When receiving a MAC packet from the office LAN 2#i, the SW 4#i searches the learning table using the destination MAC address (destination address) of the packet, and then performs the following operation. FIG. 20 is a diagram showing packet forwarding patterns.
(i) When the destination address of the packet has already been learned, and a port corresponding to the destination address is not the input port of the packet and is a LAN port, the SW 4#i forwards the packet only to the corresponding port as shown in No. 8 in FIG. 20.
(ii) When the destination address of the packet has already been learned, and a port corresponding to the destination address is not the input port of the packet and is a WAN port, the SW 4#i converts the packet into an ATM cell, and then forwards the ATM cell to the corresponding WAN port as shown in No. 3 in FIG. 20.
(iii) When the destination address of the packet has already been learned, and a port corresponding to the destination address is the same as the input port of the packet, the SW 4#i discards the packet as shown in No. 2 in FIG. 20.
(iv) When the destination address of the packet has not been learned, the SW 4#i forwards the packet to all ports accommodating LAN interfaces other than the input port of the packet and to ports on the WAN 6 side as shown in No. 1 in FIG. 20.
Also for a packet inputted to an input port connected to the WAN 6 side, the SW 4#i searches the learning table using the destination address of the packet, and then performs the following operation.
(i) When the destination address of the packet has already been learned, and a port corresponding to the destination address is not the input port of the packet and is a LAN port, the SW 4#i forwards the packet to only the corresponding port as shown in No. 5 in FIG. 20.
(ii) When the destination address of the packet has already been learned, and a port corresponding to the destination address is not the input port of the packet and is a WAN port, the SW 4#i forwards the packet to the corresponding WAN port as shown in No. 7 in FIG. 20.
(iii) When a port corresponding to the destination address of the packet is the same as the input port of the cell, the SW 4#i discards the packet as shown in No. 6 in FIG. 20.
(iv) When the destination address of the packet has not been learned, the SW 4#i forwards the packet to the LAN side ports and the WAN 6 side ports other than the input port of the packet as shown in No. 4, in FIG. 20.
A broadcast packet is not learned and is forwarded to all the ports at all times. The conventional switch, however, has the following problem. Since lines on the WAN side are expensive, it is desirable to reduce traffic as much as possible. When a packet whose address has not been learned and a broadcast packet flows on the WAN side having a loop configuration, packets at the SW 4#i increase, whereby the entire network is paralyzed by congestion. There is a method for preventing this, which forces a line in a loop state to be disabled using a spanning tree protocol (STP). However, this method lets an expensive WAN line idle, and therefore is not economical.